package patrol.mobile.com.mobilepatrol.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.dl7.recycler.adapter.BaseQuickAdapter;
import com.dl7.recycler.adapter.BaseViewHolder;

import patrol.mobile.com.mobilepatrol.R;
import patrol.mobile.com.mobilepatrol.activity.office.KeShiKeYuanActivity;
import patrol.mobile.com.mobilepatrol.bean.KeShiListBean;

/**
 * Created by K on 2018/9/18.
 * des: 绩效汇总的科室
 */
public class KeShiAdapter extends BaseQuickAdapter<KeShiListBean> {
    public KeShiAdapter(Context context) {
        super(context);
    }

    @Override
    protected int attachLayoutRes() {
        return R.layout.item_jixiao_keshi;
    }

    @Override
    protected void convert(BaseViewHolder holder, final KeShiListBean item) {
        holder.setText(R.id.tv_num, (holder.getAdapterPosition() + 1) + "");
        holder.setOnClickListener(R.id.tv_zhiwei, new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //点击科员跳转
                Intent intent = new Intent(mContext, KeShiKeYuanActivity.class);
                intent.putExtra("id",item.getId());
                mContext.startActivity(intent);
            }
        });
        holder.setText(R.id.tv_keshi, item.getOrgName());
        holder.setText(R.id.tv_score, item.getTotalScore() + "分");

    }
}
